Skip to content

Reuse canonical Todo reads across quota and refresh projections - #8302

Merged
huangruiteng merged 38 commits into
mainfrom
codex/small-kernel-todo-projection-20261107
Nov 8, 2026
Merged

huangruiteng merged 38 commits into
mainfrom
codex/small-kernel-todo-projection-20261107

Conversation

@cocolord

@cocolord cocolord commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Quota and refresh qualification previously sent matching canonical Todo inputs through separate projections. The existing TypeScript transaction materializes the requested views together, preserving independent metadata, actor/clock binding and source, revision, lease and replay checks. The refresh adapter sends its User/Agent summaries through that transaction. Caller-supplied sources and references retained after request scope closure keep their standalone path.

The proposal also preserves legacy asset selection for shared objects/equal copies, uses bounded lossless gzip for large composed results and pairs identity/head only for existing-only readonly SQLite stores. Provider selection and the final independently reopened incarnation check remain. Existing CLI/readback callers consume the change; no new product operation or configuration is added.

The latest bounded companion change computes a POSIX relative-directory prefix once per directory, avoiding an extra relative Path object for each candidate source file. Full source selection, sorted metadata tuples, Path.stat and platform error policy remain. It preserves full-source hashing and every freshness/identity/revision/WAL/lease/receipt/recovery fence, with no cross-request authority cache or new vocabulary. Python remains the filesystem transport adapter; TypeScript retains its rule ownership.

Final proposal head: 0768853b5f1ef648f388840eb4ca9039e943cb2f, over target main 21013c0c113445b71a30f6ce06ab61455b56f1f2. Tested runtime: a57fd3ef771013c80add55821321e98e577836e6; the two final checkpoint commits change only the bilingual RFC. Among the original 24 production files, only effect_runtime.py changes after parent 24ca29f4eb2afe0bbf27df00002abd005febf256. The new isolated wheel matches 1840 packaged tracked sources; five unchanged source-only files remain outside package-data patterns. Identical whole source/wheel inventories or fingerprints are not claimed.

Validation:

  • 64 relevant Python cases, kernel mypy and focused Ruff pass. Existing cases preserve one metadata observation per selected file, source changes on the next request, links/non-files/error policy and runtime ownership.
  • The immutable parent and head scanners produce the same 404 complete metadata tuples over the same real source tree. Real before/head runtime.ping calls in disposable copied packages rotate fingerprint and PID after an owned JSON file changes. Deliberately omitting that JSON source makes the same independent native oracle fail. All owned probe runtimes stop through their existing owner.
  • Eight before/head × source/wheel × File/SQLite 101-Todo lifecycles preserve sum45, original completion time, required scopes, four committed receipts, one debit, controlled restart, changed-evidence refusals and completion/writeback/spend/terminal/settled-Turn replay. Exact package/interpreter and prequota warm-PID oracles pass; both native daemons exit in every case. These are correctness and real-path checks, not performance samples.
  • The preceding runtime premerge passes all six direct checks and 18/19 selected checks. Current-head results are recorded below. The existing peer hard-cut smoke failure remains a validation hold; public-boundary checks pass. The same failure was previously reproduced on target main, and its benchmark README source remains unchanged.
  • Earlier real PostgreSQL 16.15 store391/service11 qualification remains attached to its unchanged TypeScript store/service owners. No new PostgreSQL run, host/wheel or installed-host/model qualification is claimed.

One independent wheel attribution pair at main 21013c0c1 / prior proposal 24ca29f4e retains all original lifecycle/provenance/exit oracles. Each arm records 22 Python console processes, three independent Node helper/probe processes and two managed daemons. Node programs retain exact executable/argv; Python CPU profiles use process_time.

Diagnostic CPU, seconds, main → prior proposal Observation
Python CLI self before profile dump 20.447 → 20.099
Python profile exclusive total 18.230 → 17.922
Import machinery cumulative 14.505 → 14.403
Compilation exclusive 7.488 → 7.464
Complete managed-daemon subtree 1.780 → 1.890
Three independent Node helper/probe subtrees 0.286 → 0.281

Import cumulative includes nested compilation and cannot be added to compilation or Python self CPU. Imports may occur inside an operation; this does not separately identify interpreter startup. Loading/compilation is prominent under the fixed bytecode-disabled condition, while helpers contribute little within this observed scope. Profiler/wrapper overhead and publication tails remain; this diagnostic neither explains the earlier frozen paired CPU increase nor establishes speed or normal-bytecode installed benefit.

The frozen 20-case source/wheel default-SQLite cost comparison remains unchanged at main 21013c0c1 / runtime 9e147ddf2:

Observation median, main → prior proposal Source Wheel
Whole harness wall, seconds 25.904 → 26.477 26.248 → 26.489
Observed process CPU, seconds 17.489 → 17.749 17.984 → 18.341

Observed CPU is higher in 4/5 pairs in each distribution, and wall ranges overlap. Whole-path/marginal-cost benefit remains unqualified. No frozen sample is rerun, expanded or relabeled. Observer exit tails, physical-device writes, continuous system peaks, environment/build costs, model/attention and installed adoption remain unknown or outside qualification.

An independent wheel import probe first loaded source from the checkout working directory. That preparation failure remains recorded; qualification now uses a non-checkout cwd, clears PYTHONPATH and asserts module ownership by the isolated install before comparing packaged bytes. The lifecycle harness keeps its own independent package checks. A first wrong-directory Chat build command also failed; the dashboard owner's build subsequently verifies the bundle.

Bounded refactoring applied: simplify fresh source path construction in the existing adapter, with complete metadata/real-runtime/lifecycle parity. The default-cache correctness question is now exercised. Wider quota/context or refresh loading changes require inspection of the existing callers' required dependency closure and normal-default semantic parity; local counts and cache validity do not certify complete benefit.

Keep I3 for at least one minor release, M1/#8011, full R0/V10/R1, D2/D5/D6/D3, context/model/split-install, PostgreSQL host/wheel and full-cost/adoption acceptance open. The original work remains open for independent exact-head review and readiness. No main merge or installed-host upgrade is included.

Historical failures and complete boundaries remain in the English and Chinese RFC checkpoints.

One new normal-bytecode before/head wheel pair at source 24ca29f4e / 1a4d9d8f9 preserves the complete 101-Todo artifact, original completion time, required scopes, four receipts, one debit, unchanged prequota warm PID set, controlled restart and refusal/replay. Both native daemons and all three Node helpers exit in each arm. No prior frozen sample is repeated, expanded or relabeled.

Both arms use fresh isolated wheel installations and byte-identical fresh fixture copies, with the same CPython 3.13.5 and package versions. Installation/fixture pyc starts at zero; pre-run imports use -B outside checkout, clear PYTHONPATH and assert installed ownership before matching all 1840 packaged tracked hashes. Actual lifecycle processes use default bytecode with disable/cache-prefix/importtime variables unset. Installed pyc path sets agree at every recorded phase: 317 after setup, 358 after bootstrap, 433 after prequota, 665 after guard/required reads and 699 after settled replay/teardown. LoopX contributes 223, 264, 339, 571 and 605 respectively; all 605 final headers match source timestamp/size and interpreter magic. These are cache-validity observations, not one guard's module count or import CPU attribution.

Actual console-PID observation remains incomplete. The first OS observer misread macOS's PID count as a byte count; before records 0/22 actual console PIDs. A disposable child probe corrects that interpretation, and the unstarted head records 21/22; bootstrap remains outside the bounded sampling window. All 22 wrapper command/phase/PID/exit records remain, but both actual-PID subchecks fail and are retained. Neither lifecycle is rerun. The observer correction changes sampling waits, and head bootstrap has a large wall delay. Raw wall 24.044/25.180 seconds and observed process CPU 10.698/10.724 seconds are diagnosis only, with fixture/verifier/observer/readback and orphan accounting included. They cannot qualify speed or regression, explain frozen CPU differences or be subtracted from the disabled-bytecode profile. Default-mode import/compilation CPU remains unresolved.

Only the paired RFC changes in this update. Runtime sources retain the previously tested production bytes; no new PostgreSQL, installed-host/model or full marginal-cost qualification is claimed. The original task stays open. The next bounded work inspects the existing should-run/context-read/refresh-state dependency closure before choosing a complete reversible loading slice; this pair will not be repeated to recover PID observations.

Current exact-head standard premerge at 0768853b5f1ef648f388840eb4ca9039e943cb2f passes all six direct checks and 18/19 selected checks. The sole remaining failure is the existing peer hard-cut scanner at unchanged benchmark README line 976; the current direct diagnostic reproduces that known hold. The first premerge also failed because TypeScript dev dependencies were absent in the new worktree; after the existing npm ci --ignore-scripts setup, the semantic scan passes and the prepared standard run retains only the peer hold. Public-boundary checks pass. The separate full loopx check still reports unrelated registered-Goal authority/source errors; its public scan completes successfully. No merge readiness or approval is claimed.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

使用 LoopX 托管工作的人需要在一次调度里看清要做的任务,并在进程重启后从原任务继续。以前,同一次调度如果要读取待办摘要、执行计划和已结束任务,会把同一批任务数据多次传给投影进程。新实现可以传一次数据就取得三个结果;只需要一个结果的调用也会被打包,本次复现了额外计算和写盘。这次改动处理视图传输;任务存储、领取、权限和结算仍沿用原来的规则。

完整来源事务和端到端成本验收仍待完成;本 PR 可以先把复用限制在确实要读多种视图的路径。

改动思路 / Approach

复用完整来源的方向成立;打包范围应由知道要读取哪些视图的调用方决定。本次边界是一次托管请求中的 Todo 展示传输,已保存的 Todo、权限和结算仍由原有组件负责。 在实际 guard 中,Python 先拿到当前完整任务数据,再以完整 JSON 和传输选项在本次请求内识别可复用的结果。TypeScript 原投影函数仍解释任务状态;按任务 ID 寻找运行结果的调用方仍只取它要求的那一种。记录、权限和结算来源不经过这个缓存。优先让现有 quota 组装逻辑选择要读的视图,保留其他调用方的旧路径,可以交付这部分复用,不必等待整个来源事务重构。

具体改动 / Changes

关键代码讲解

  • effect_runtime.py:1622:在已固定运行时版本的请求中,只要来源和选项符合形状且输入不超过约 2 MiB,就把请求替换成三个视图。缓存键包含来源和选项;命中后重新解码,避免一处改动影响另一处。三种返回缺任何一项都会在写缓存之前失败。
  • context_projection.ts:35:按原 TypeScript 函数分别生成摘要、计划和保留终态。只有摘要使用已清除交接门禁;未改变记录类型或权限解释。现有 project_delivery_response(delivery_history.py:93)只请求 retained terminal,却会收到三个完整数组后丢掉另外两个。
  • 七个文件中,运行代码为 +49/−2;测试 +161,双语 RFC +103。最后一次更新增加配对的后续设计说明和 PostgreSQL 快照组合测试。现有单视图路径仍供大来源和非托管请求使用,File/SQLite 的持久记录和重放身份沿用原来的代码。

规范基线:docs/architecture/rfcs/monorepo-distribution-split-v0.md,修订 94b91e48aa4a2cdafe9d4d31d918fe84d0112b41。I2 已实现:保留原任务权限、投影和结算 owner。I8 已实现于本次对照的完整来源、门禁及原凭证路径:来源更新和下一次请求重新读取。I9 已按本切片落实:分开报告数据量、执行环境和范围。V10 / R0 的完整默认 SQLite 成本资格仍待验证。

对主干的风险 / Risks

[P2] 单视图读取会计算并写出两个无人消费的视图。 同一真实投影调用、相同 8,000 条开放 Todo 和继承关系,运行一次 retained terminal 读取。基线请求 1,128,077 B、响应 3,728,136 B,走套接字;候选请求 1,128,078 B,计算三套各 8,000 行,落盘并同步一个 11,184,165 B 的私有快照。最终投影哈希相同。只让该调用保留旧的单视图请求后,候选又返回 3,728,136 B,不再写快照。 写盘分支沿用既有校验,也会同步文件;输入小于 2 MiB 并不能保证三个结果都能留在 8 MiB 的套接字响应上限内。即使留在内联上限内,单视图也会承担其他两套计算。同机 Node v24.21.0、CPython 3.14.8,warm broker,每臂 5 次无传输探针计时:8,000 条 retained 视图中位数 0.216→0.835 s;15,000 条短记录 0.232→1.478 s。这是单个源码调用的诊断,不外推为整个 CLI、后端或长程收益。

保留通用单视图入口,把打包放到明确同时消费多种视图的组装调用方;继续由原 TypeScript 投影 owner 执行。增加仅消费一种视图的实际 transport 对照,并在默认 SQLite 路径同时核对请求、响应、临时文件和回执。

复现时,在基线与候选分别启动隔离的本地 Effect 进程,构造 8,000 条开放 Todo:ID 按 todo_build_00000 编号,每条短正文,successor_todo_ids 指向下一条。将其作为 {"items": rows},在 effect_runtime_request_scope() 中只调用一次 project_delivery_response(首条 Todo,delivery_outcome="outcome_gap",outcome_followthrough_required=True)。记录该次 todo.context.page 的响应和 _read_local_snapshot_response 收到的 result_ref.byte_count。对照路径仅给现有单视图源加对该分支无影响的 strip_text=False,从而跳过新打包条件;保留相同最终结果,并核对快照读没有发生。

验证 观察
PASS · 实际 File/SQLite 领取、校验、归档及恢复 源码 CLI 对同一 101 条 Todo fixture 的 File/SQLite 基线与候选四组均通过:一次独立校验、一次写回、一次扣额;四种原结算凭证和完成时间可恢复,已确认原 Effect 进程退出、新进程重放、替换证据被拒。
PASS · 多视图的预期收益 同一 101 条 Todo guard 的参数 JSON:File 841,869→726,162 B;SQLite 842,360→726,653 B;均 82→80 次调用,加载 503 模块不变。
FAIL · 仅消费一种视图 真实 Effect 返回保持相同;额外输出触发约 11.18 MB 私有文件写盘。
PASS · 回归与源码检查 前一提交的 242 项 Python 和四组实际 CLI 生命周期覆盖的实现、测试与依赖在新提交中逐字不变;新提交重跑 16 项批处理测试、60 项 TypeScript(含 56 项聚焦投影测试)和实际写盘复现。 类型检查、Ruff、双语 RFC 和差异检查通过。改变来源、交接门禁、调用方修改返回值、大来源、独立请求和缺失视图都有覆盖。
UNVERIFIED · PostgreSQL 最新提交新增 PostgreSQL 原生快照组合测试;本机没有隔离 PostgreSQL,测试加载后跳过,作者的数据库证据未独立复跑。
UNVERIFIED · 托管 CI 和独立安装 本轮采用源码验证,未查托管 CI。

语义与 CI 对齐

新键只在共同发布的 Python 和 TypeScript 间传递读视图,复用原 Todo 状态和权限语义;没有新持久状态、额外的执行授权或新的提示义务。大来源、不在请求 scope 的来源和其他投影模式仍走原路径。本轮的阻塞点是默认打开的投影工作量;现有测试通过不能排除这个回归。

我的整体评价 / Verdict

多视图复用减少了同一真实 guard 的调用与输入字节,且在 File 和 SQLite 的配对案例中保留了原任务、完成时间、回执和重启后的继续条件。单视图路径增加了等待和同步写盘,用户得到的内容相同,因此当前提交仍需修改。建议保留现有单视图通道,在明确需要多个结果的调用点打包,并重跑两种负载和原结算验证。本次改动位于托管 CLI 和共用 Todo 投影的内部传输层,没有改动页面布局。未运行已安装 App、真实模型、完整默认 SQLite 成本对照或长期采纳试验。

English verdict: REQUEST_CHANGES for 7f85fce90ece3263626c0f1b099a8f01869f2d1a. Keep one-view reads on the existing transport and bundle only at callers that request multiple views.

Comment thread loopx/control_plane/effect_runtime.py Outdated
size = MAX_REQUEST_BYTES
# Reserve space for all three results under the existing ceiling.
# Larger sources retain their original single-view transport.
if size <= MAX_REQUEST_BYTES // 4:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 只读取一个视图时保留现有通道。 同一真实投影调用、相同 8,000 条开放 Todo 和继承关系,运行一次 retained terminal 读取。基线请求 1,128,077 B、响应 3,728,136 B,走套接字;候选请求 1,128,078 B,计算三套各 8,000 行,落盘并同步一个 11,184,165 B 的私有快照。最终投影哈希相同。只让该调用保留旧的单视图请求后,候选又返回 3,728,136 B,不再写快照。 保留通用单视图入口,把打包放到明确同时消费多种视图的组装调用方;继续由原 TypeScript 投影 owner 执行。增加仅消费一种视图的实际 transport 对照,并在默认 SQLite 路径同时核对请求、响应、临时文件和回执。

@cocolord
cocolord force-pushed the codex/small-kernel-todo-projection-20261107 branch from 7f85fce to c926f56 Compare November 7, 2026 17:29
@cocolord cocolord changed the title refactor(todos): reuse complete source display views per managed request refactor(todos): compose display views at the quota caller Nov 7, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

使用 LoopX 托管任务的人需要在一次调度内获得下一步,并在验收要求更新后继续原轮次。原 quota guard 会把同一个任务来源分别传给摘要、计划和保留终态的投影。新提交在常规小负载减少传输,但一条原轮次恢复路径中断,另一条合法输入路径新增了同步写盘。本切片仅交付展示传输的复用,沿用现有 Todo 存储、领取、权限和结算规则。

后续还需把同一次来源读取和默认 SQLite 的端到端成本作为独立验收。当前增量先补齐原轮次恢复与结果侧传输边界。

改动思路 / Approach

quota 调用方知道实际消费的视图,适合在此集中复用来源,并复用已有的回执上下文与独立视图。本次边界是 quota guard 中的 Todo 展示传输与已有的续跑输入,TypeScript 继续负责投影语义。 Python 选取一份当前来源,按明确的三视图请求交给原 TypeScript 投影。摘要使用现有交接门信息,计划和保留终态沿用各自的选择规则。既有请求缓存仍按完整输入区分,返回形状验证通过后才复用。单视图回读的复验通过,旧问题在本提交已解决。

具体改动 / Changes

  • quota 组装显式请求三种视图,并把保留终态传给 frontier。带原回执的备用分支在恢复当前上下文时也需要这份终态。见 quota frontier 与 原回执分支。
  • TypeScript 复用三个已有视图,拒绝混合请求。Python 验证返回的三组对象,通用单视图继续用各自的请求形状。见 视图分派 与 返回形状验证。
  • 五个运行文件共 +81/−13,三个测试文件 +243,双语 RFC +188。与当时主干的合并模拟保留相同的十文件净改动。

按基线 dee54966327e09406b3f7b17d155b03cd633b234 的 docs/architecture/rfcs/monorepo-distribution-split-v0.md 核对。I2 的投影与结算所有权沿用原路径。I3 的独立视图与大请求回退已对照。I8 的原轮次恢复未满足。I9 的本次证据分别列出入口、负载与响应。V10 / R0 的默认 SQLite 完整成本仍待验收。 已接受的 RFC

对主干的风险 / Risks

[P1] 原重规划回执恢复引用了已删除的变量。 实际 CLI 先得到 autonomous_replan_required 和一张原轮次回执。补充验收要求并关联等待中的后续工作后,基线 8 例全部恢复,新提交 8 例均在第二次 should-run 返回 quota_unexpected_collection_error。File 和 SQLite 的诊断复跑各保留一张原回执,扣额仍为零,CLI 无法交付该轮次的继续信息。 当原 obligation 仅带结构化复核类型和停止条件时,attach_receipt_replan_context 仍求值 replan_todo_items。在候选进程内只替换这一个参数表达式的对照中,File 和 SQLite 各恢复原身份、通过现有完整用例,读回原轮次的唯一扣额。 把 agent_todo_terminal_source_items 同时传给 attach_receipt_replan_context,并用 File、SQLite、stride 开关和并行 vision gap 的八个既有用例复验原身份、验收信息更新和一次结算。 备用分支

复现命令

uv run --extra test pytest -q tests/control_plane/test_quota_settlement_cli.py::test_replan_reentry_after_outcome_work_refinement_keeps_original_turn

[P2] 合并视图触发原先可内联的同步写盘。 在源码 quota 组装入口给相同 8,000 条带 successor 链的合法 Todo,基线三个 3,728,136 B 结果各自内联。候选把 1,128,293 B 请求合并,结果越过 8 MiB 上限,写入并同步 11,184,165 B 私有文件,再由 Python 读回。准入结果指纹相同。同一候选仅恢复三个已有视图调用,仍得到相同结果,三个响应各自内联。 让 quota 批处理同时遵守结果侧的传输预算。可能越过内联上限时沿用独立视图或按有界结果分组,用相同来源检验视图结果和实际快照次数,保留已恢复的单视图通道。 批处理分支

用 8,000 条 open/agent Todo,短正文并给每项一个 successor_todo_ids 环链。将完整 items 和首项放入 agent_todos 的状态源,在 effect_runtime_request_scope 下调用 build_quota_should_run,记录 todo.context.page 的请求、返回长度和私有结果文件。在候选只替换 quota 调用点为原三个 selector,比较结果指纹与落盘次数。 实际 SQLite 源码 CLI 的另一个 5,201 条短记录场景,请求约 2.23 MB,超过批处理输入上限。基线、候选及独立视图对照均内联,得到相同调度结果,扣额为零。 8,000 条案例使用合成的完整状态与真实本地 Effect,验证的是传输路径。

本地验证 观察
通过 · 普通 CLI 生命周期 101 条 Todo 的实际源码 CLI 进行 File/SQLite 基线与候选四臂对照。普通领取、校验、归档、写回和进程重启后读回通过,原四种结算回执保持一致,每臂各一次校验、写回和扣额,替换证据被拒。
通过 · 小负载传输 同一 101 条 fixture 中 guard 调用均从 82 降至 79。参数 JSON 在 File 从 841,863 降至 716,856 B,SQLite 从 842,354 降至 717,347 B。加载模块数均为 503。
通过 · 旧单视图问题 仅查询 retained terminal 的实际 Effect 对照中,8,000 条带链接记录在基线和候选均为 1,128,077 B 请求和 3,728,136 B 内联响应,结果指纹相同,快照次数均为零。
失败 · 原轮次恢复 基线 8/8 通过,候选 0/8。工作流范围 Ruff 指向同一未定义名称。
失败 · 合并结果传输 8,000 条配对案例新增 11,184,165 B 同步文件。
通过 · 其余检查 90 项聚焦 Python、10 项其他回执恢复用例、40 项 TypeScript、类型检查、双语 RFC、语义 diff 与标准 premerge 通过。
待独立验证 本地缺少隔离 PostgreSQL,新增的实际 PostgreSQL 快照组合测试加载后跳过,作者的数据库结果未独立复跑。 已安装客户端、真实模型和完整默认后端成本也未覆盖。

语义与 CI 对齐

展示类型和权限判断沿用原有 owner,当前改动影响准入前的传输与原回执的恢复输入。标准预检通过后,既有的八个实际 CLI 用例仍可独立复现恢复回归。本轮未查询托管 CI。

我的整体评价 / Verdict

本提交恢复了单视图传输,在普通 File 和 SQLite 场景里减少了 guard 调用。原回执仍须在验收工作链接变化后继续。先恢复终态输入,再把批处理限定在响应可以有界传输的情形,并以两种存储的原轮次用例和大结果配对验证修复。

English verdict: REQUEST_CHANGES for c926f5602f6b2826496dd735b99e0c1fc553b0a0. Preserve receipt-bound replan recovery and bound the quota bundle's response transport.

user_todo_summary=user_todo_summary,
agent_todo_summary=agent_todo_summary,
agent_todo_source_items=replan_todo_items,
agent_todo_source_items=agent_todo_terminal_source_items,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 给原回执的恢复分支传入同一份终态。 删除本地来源后,下面 attach_receipt_replan_context 的 todo_items=replan_todo_items 仍引用旧名。实际 CLI 先得到 autonomous_replan_required 和一张原轮次回执。补充验收要求并关联等待中的后续工作后,基线 8 例全部恢复,新提交 8 例均在第二次 should-run 返回 quota_unexpected_collection_error。File 和 SQLite 的诊断复跑各保留一张原回执,扣额仍为零,CLI 无法交付该轮次的继续信息。 在候选进程内只替换这一个参数表达式的对照中,File 和 SQLite 各恢复原身份、通过现有完整用例,读回原轮次的唯一扣额。 把 agent_todo_terminal_source_items 同时传给 attach_receipt_replan_context,并用 File、SQLite、stride 开关和并行 vision gap 的八个既有用例复验原身份、验收信息更新和一次结算。

"planning": todo_planning_source_items(value),
"terminal": todo_planning_source_items(value, include_terminal=True)}
try:
result = effect_runtime_result("todo.context.page", request, large_local_snapshot=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 把响应侧纳入批处理边界。 在源码 quota 组装入口给相同 8,000 条带 successor 链的合法 Todo,基线三个 3,728,136 B 结果各自内联。候选把 1,128,293 B 请求合并,结果越过 8 MiB 上限,写入并同步 11,184,165 B 私有文件,再由 Python 读回。准入结果指纹相同。同一候选仅恢复三个已有视图调用,仍得到相同结果,三个响应各自内联。 让 quota 批处理同时遵守结果侧的传输预算。可能越过内联上限时沿用独立视图或按有界结果分组,用相同来源检验视图结果和实际快照次数,保留已恢复的单视图通道。

@cocolord
cocolord force-pushed the codex/small-kernel-todo-projection-20261107 branch from c926f56 to 957bf0e Compare November 7, 2026 20:31
@cocolord cocolord changed the title refactor(todos): compose display views at the quota caller refactor(todos): compose canonical quota projection from one provider read Nov 7, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

使用托管 quota guard 的 Agent 需要选出当前任务,并在验收条件更新后继续原轮次。原 guard 对同一来源分别投影摘要、规划和保留终态。这个增量把查询和选择留下的来源信息交给既有 TypeScript 投影。实际 guard 减少了请求,原轮次重入也恢复了。本次改动沿用已有的存储、权限与结算规则。剩余问题是旧 asset 的兼容性、大结果的落盘和完整生命周期成本。依据是主干已接受的 I2、I3、I8、I9 以及 V10 / R0 的分阶段验收。 RFC

改动思路 / Approach

普通 guard 将 User 与 Agent 的来源引用交给同一次 Todo 投影。相同引用在一次事务内共享 provider 读取,store identity、revision、cursor 和完整字段摘要用来拒绝已变化的来源。TypeScript 沿用现有选择、恢复规划与视图投影。保留一次来源读取,同时把旧格式选择和响应边界交给现有的 owner。Python 继续组装调用和解码结果,原回执和扣额由现有生命周期处理。

具体改动 / Changes

  • 审查 e7db1711f8bbf317a0d28e910edb7705b8845e3b。实际改动 26 个文件,+1,644/−90。分支 diff 与对当前主干的干净合并结果一致,包含双语 RFC、既有 guard 的来源与传输改动,以及对应测试。
  • 上轮的原结算重入已修复。同一套 File、SQLite × stride × 并行 Vision gap 用例,基线和本提交均通过 8/8。四组实际 101-Todo 源码 CLI 生命周期保留校验、归档时间、四张原结算回执及一次扣额,进程重启后仍可读回,并拒绝替换已验收证据。 原回执分支
  • 8,000 条带 successor 链的独立展示,两边的结果指纹、3,728,136 B 响应与零快照一致。普通 SQLite guard 的 5,201 条对照也选中同一 Todo,实测 15→12 次 Todo RPC,请求 JSON 约 13.78→5.36 MB,均未落盘。 来源事务

对主干的风险 / Risks

[P2] 保留旧 project asset 的来源类型。 当顶层 agent_todos 和 project_asset.agent_todos 引用同一个旧格式对象时,source is canonical 会把优先选中的 asset 交给 canonical 摘要。用带一条合法 Todo 的旧格式 total="3", open="1", done="2" 复跑,基线及候选的等值复制对照都返回总数 3、完成 2。只有候选的共享对象路径将两项变成 null。只有 next 的旧格式输入还有准入差异,基线及候选的等值复制均拒绝缺少 Todo ID,候选共享对象返回可正常交付且没有选中 Todo。请让 selector 同时返回来源和投影类型,并对共享对象及等值副本复跑普通 guard。 来源类型分支

[P2] 给 quota 合并响应设定结果边界。 对同一隔离 SQLite fixture 的 6,401 条 Todo 执行源码 quota should-run,两边均选中同一任务且扣额为零。候选的 Todo 请求 JSON 从 16,939,228 降到 6,594,824 B,但两份 native reference 的 quota_projection 将三种视图和 wait basis 合成一个响应,新增一次 8,871,032 B 的私有快照写入、同步和读回。基线快照为零。此次观察覆盖传输和写盘,总延时仍待同负载对照。大输入回退测试走的是独立展示 helper,普通 guard 直接走 quota_projection。请保留一次来源读取,同时限制单个结果帧,按既有视图分段或复用同值行,并在 5,201 和 6,401 条相同输入下核对准入、响应和写盘。 批量结果组装

本地验证 观察
File / SQLite 生产入口 4 个实际生命周期,基线与候选各通过 8 项原轮次重入。147 项聚焦 Python、27 项冻结输出和 59 项 TypeScript 通过。
PostgreSQL 16.15 隔离实例 391 项存储和 11 项服务测试通过,零跳过。已安装宿主的完整 PostgreSQL 生命周期待验收。
变更范围检查 变更 Python 文件 Ruff、TypeScript 类型检查、双语 RFC、签署与公开边界检查通过。
仓库级检查 标准预检 6 个直接检查全过,18/19 项选择检查通过。未变的 peer 边界扫描在基线也失败。全范围 Ruff 的 4 条诊断和 mypy 的 1 条诊断在两边相同,仍是验证项。

完整生命周期的边际成本、已安装宿主和真实模型采用仍待独立验证。本轮按队列配置使用本地验证,托管 CI 未读取。

我的整体评价 / Verdict

新版本已恢复原轮次重入,并在实际 guard 中采用了来源引用。下一版需要固定旧 asset 的来源选择规则,并让大列表的结果传输可控。两个问题都有同输入的对照,修复后可用现有 guard 和已知任务结果复验。

English verdict: REQUEST_CHANGES for e7db1711f8bbf317a0d28e910edb7705b8845e3b. Preserve legacy asset projection regardless of object aliasing and bound the composed quota response.

source = _select_todo_source(canonical, asset)
if source is None:
continue
kind = "user" if source is canonical else "project_asset"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 保留旧 project asset 的来源类型。 同内容的旧格式资产,基线和候选等值复制路径保留 total_count='3'、done_count='2'。候选共享对象路径两项为 null。只有 next 时基线及等值复制拒绝缺少 Todo ID,候选共享对象却返回 normal_delivery_allowed=true 且 selected_todo=null。 选择来源时同时返回投影类型,并核对旧格式共用对象和等值副本的摘要与准入。

const summary = requireJsonObject(request.summary_request, "summary request");
if (summary.consume_display_views === true) {
const display = {source: summary.source, handoff_gates: (request.handoff_items as JsonObject[]).map(row => row.display)};
wire.display_views = projectTodoContextPage({summary_display_views: display});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 给 quota 合并响应设定结果边界。 6,401 条 SQLite 实际 guard,任务与扣额一致,Todo 请求 JSON 16,939,228→6,594,824 B。基线零快照,候选合并响应在私有文件写入并同步 8,871,032 B。 保留一次来源读取,为完整 quota 响应分段或复用同值行,核对结果与实际快照次数。

@cocolord
cocolord force-pushed the codex/small-kernel-todo-projection-20261107 branch from e7db171 to 2ca24f4 Compare November 7, 2026 21:41
@cocolord cocolord changed the title refactor(todos): compose canonical quota projection from one provider read refactor(todos): compose canonical quota sources and bound responses Nov 7, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

运行托管 quota guard 的 Agent 需要读到当前任务,并能在验收条件变更后继续原轮次。原入口分别投影摘要、规划与终态,完整来源也会重复传入 Effect。当前提交在实际入口复用来源,压缩后的大响应避免上轮新增的组合快照,旧格式准入仍有一处退化。本轮核验现有来源、兼容输入、原轮次结算和结果传输。已安装宿主的持续采用、真实模型消耗和完整生命周期成本仍待各自验收。

评审基于 8a4d4f9dab17b01d6fe3546936155b4d718fc20d 的 docs/architecture/rfcs/monorepo-distribution-split-v0.md。I2 保持唯一的类型化决策和写入 owner。I3 要求现有调用与兼容入口持续可用。I8 要求保留重入身份和效果。I9 要在真实入口量资源边界。V10 / R0 的完整开销资格仍开放。

改动思路 / Approach

普通 guard 把 User 与 Agent 的来源引用交给同一个 Todo 读取事务,再由既有 TypeScript owner 组装视图。来源合并和结果压缩可继续复用原 owner,旧 asset 的来源类型需要由已有 selector 明确返回。用既有的来源修订、cursor、digest 和调用者绑定判断能否共用读取,再通过原结果适配器传输完整字节。旧入口须按获选来源的契约解析,不能从对象引用反推来源类型。

具体改动 / Changes

  • 当前提交的实际主干合并范围为 30 个文件,覆盖 native source recipe、User/Agent 投影、结果适配器、验证和双语 RFC。PostgreSQL 真实隔离实例验证了当前来源的完整性、旧引用拒绝和既有服务准入。File 与 SQLite 的原轮次重入在相同源码条件通过 8/8。
  • readTodoRuntime 在组合 quota 响应跨过原 inline 边界时使用有界 gzip。Python 消费端校验分页标识、编码、解压长度和终止,测试涵盖未知编码、截断、尾部成员与长度错误。实际 SQLite guard 的 6,401 条对照选中同一 Todo,均零扣额。Todo RPC 为 15→12,请求 JSON 为 16,939,228→6,594,824 B。上次头的 8,871,032 B 组合快照在当前版本消失,组合响应从 socket 读回。
  • 8,000 条的同一公开 CLI 对照保持任务与零扣额。两边都有一次既有 canonical_fields 快照,基线 8,649,563 B,候选 8,650,540 B。候选 quota_projection 无额外快照。6,401 和 8,000 条两组区分了既有来源读取与新组合响应。加入长且低重复度的证据字段后,实际 guard 通过两段 gzip 结果读回约 26.94 MB 的完整组合结果,零组合快照,任务与扣额仍一致。隔离安装的 wheel 复现了下方的旧 asset 回归。

对主干的风险 / Risks

[P2] 让旧 asset 的获选来源携带类型。 在同一份合法旧格式 asset 上切换共享对象和等值副本,当前提交只有共享对象将总数和完成数从 3、2 变成 null。只含 next 的旧格式输入,主干和候选的等值副本都因缺少 typed Todo ID 拒绝,候选的共享对象却允许正常交付且 selected_todo=null。触发点是 _select_todo_source 按结构把旧 asset 排在前面后,调用者仍用 source is canonical 选 codec。请让既有 selector 明确返回获选分支类型,并用同一个 public quota builder 检查这四个场景。隔离安装的 wheel 得到同样结果。 当前分支

本地验证 观察
实际 quota 与恢复 6,401 和 8,000 条 SQLite guard 准入一致,组合响应无快照。基线、候选和隔离 wheel 各通过 8 项 File/SQLite 原轮次重入。
直接检查 84 项聚焦 Python、22 项聚焦 TypeScript、变更范围和工作流范围 Ruff、TypeScript 类型检查、双语 RFC、签署及公开边界通过。
PostgreSQL 实际 16.15 隔离实例中通过 391 项存储及 11 项服务测试,零跳过。已部署宿主的完整 PostgreSQL 生命周期仍开放。
仓库级资格 标准预检 6 项直接检查通过,所选 18/19 通过。未变化的 peer 扫描和 kernel mypy 诊断在主干和候选相同,保留验证失败。

语义与 CI 对齐

源码来源、托管重入和持久状态沿用既有定义。新增的 gzip 编码局限于同时交付的结果适配器,已核对适配器拒绝错误编码和帧边界。旧 asset 的获选分支仍违反 I3。托管 CI 未查询。

我的整体评价 / Verdict

请修复当前 P2。大组合结果的上轮回归已有实际 guard 的修复证据。长程执行的原结算和重入保持,旧 asset 用户的任务摘要与准入仍会因对象表示而改变。作者报告的同负载墙钟中位数为 13.894→14.974 秒,五对有四对较慢。本轮验证的是语义、调用和落盘,完整的持续成本收益还未取得资格。

English verdict: REQUEST_CHANGES for 2ca24f42754d838fa285eadebc090131ca86e5bf. The composed-response snapshot regression is repaired. A supported legacy asset still loses counts or bypasses the typed Todo ID gate when its objects alias.

source = _select_todo_source(canonical, asset)
if source is None:
continue
kind = "user" if source is canonical else "project_asset"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 让旧 asset 的获选来源携带类型。 同内容的旧 asset 共享引用使候选的总数和完成数成为 null。只有 next 时,主干和等值副本拒绝缺少 typed Todo ID,候选共享对象却允许正常交付且 selected_todo=null。隔离 wheel 同样复现。 让既有来源选择器返回实际获选的分支类型,再用共享和等值副本的合法行及 next-only 两组跑 public quota builder。

loopx-agent
loopx-agent previously approved these changes Nov 7, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

托管 quota guard 需要用当前 Todo 的完整来源,给 User 和 Agent 生成一致的视图。原入口分别读摘要、规划和终态,并在 Effect 调用里重复编码相同的来源。当前提交在实际 guard 合并兼容的读取,让大响应可以分段传回,同时保留旧 asset 的计数和缺少 Todo ID 时的拒绝。本次核验现有调用、兼容输入、原轮次结算和传输边界。已部署宿主的完整生命周期成本、持续采用和真实模型消耗仍待单独验收。

以实际主干 8a4d4f9dab17b01d6fe3546936155b4d718fc20d 的 docs/architecture/rfcs/monorepo-distribution-split-v0.md 为准。I2 保持来源、决策和写入权限归属。I3 保持现有调用和旧格式兼容。I8 保持重入身份与已完成的效果。I9 在真实入口核对资源边界。V10 / R0 的默认 provider 完整成本验收仍开放。

改动思路 / Approach

普通 guard 把 User 与 Agent 的匹配来源交给同一个 Todo 读取事务,再由既有 TypeScript owner 组装视图。来源合并、传输和旧格式选择继续由各自已有的 owner 负责。来源引用须匹配 provider、revision、cursor 和调用者。旧 asset 的 selector 同时返回获选分支和数据,调用者据此选 codec。这样沿用原有优先级,独立摘要、规划与显示入口仍读同一数据。当前修正集中在已有分支,未新增持久状态、配置或写权限。

具体改动 / Changes

  • 在真实 public quota builder 上逐一比较共享对象和等值副本。两种有类型化 Todo 的输入都保留字符串总数 "3"、完成数 "2",并选中同一 Todo;只有 next 的两种输入都因缺少类型化 todo_id 被拒绝。当前源码和隔离安装的 wheel 与基线相同。上一提交在共享对象下丢失计数并越过准入,本次探针能区分该回归和修复。
  • 相同的 6,401 条默认 SQLite Todo 输入选中同一任务,guard 均零扣额。Todo 调用从 15 次降至 12 次,参数 JSON 从 16,939,228 B 降至 6,594,824 B;早期候选产生的 8,871,032 B 组合快照在当前提交不再出现。8,000 条输入两边都保留一次已有的 canonical_fields 来源快照,均无新增组合快照。低重复度的 6,401 条输入实际读回两段 gzip 数据,共解码 26,943,346 B;选择与扣额不变。
  • File 和 SQLite 的 8 项原轮次重入用例在基线、当前源码和隔离 wheel 均通过。隔离 wheel 共通过 21 项重入和旧格式用例。当前源码另通过 105 项定向 Python 检查(含重入与旧格式)和 22 项定向 TypeScript 检查。真实隔离 PostgreSQL 16.15 通过 391 项存储和 11 项服务检查,零跳过;完整部署的 PostgreSQL 宿主生命周期仍未覆盖。

对主干的风险 / Risks

主要风险是过期来源被复用、旧 asset 错用 codec,以及分段响应失去身份或边界。配对样例检查了同输入的选择、旧入口准入和扣额;定向检查覆盖过期来源、帧边界、编码及解码长度错误。当前合并树的 Ruff、TypeScript 类型检查、双语 RFC、签署与公开边界检查通过。标准本地 premerge 的 6 项直接检查和 18/19 项所选检查通过。peer 扫描在未修改的 benchmark_toolkit/README.md:976 失败,kernel mypy 在未修改的 decision_capture.py:659 报缺失返回类型;两项在同一基线和当前提交的完整归一化诊断一致。保留这两个失败,严格本地资格仍未通过。托管 CI 未查询。

语义与 CI 对齐

既有来源优先级、类型化 Todo 准入和结算身份已核对。分段 gzip 是同时交付的生产者和消费者之间的传输变化。独立显示入口和已有来源快照仍沿用各自契约。

我的整体评价 / Verdict

批准当前提交的代码评审。原轮次恢复和旧格式准入有配对证据;组合读取和分段回传的收益已在实际 SQLite 入口观察到。作者先前在旧候选测得完整生命周期墙钟中位数 13.894→14.974 秒,五对中有四对更慢,区间重叠。作者后续也观测到额外的 SQLite 读取事务和进程写入计数,这些计数不能直接当作设备写入。本轮观测是固定输入的调用、传输及落盘边界,不能据此宣布完整成本达标。严格本地验证和合并资格仍待处理。

English verdict: APPROVE for c40d8ec311448eb2c42f90094252e8626f220aaf. The legacy asset parity, typed admission guard, original retry identity, and bounded SQLite response transport are verified. Required local gates and full lifecycle cost qualification remain open.

cocolord and others added 15 commits November 8, 2026 07:16
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@cocolord
cocolord force-pushed the codex/small-kernel-todo-projection-20261107 branch from c40d8ec to 779a4a5 Compare November 7, 2026 23:26
@cocolord cocolord changed the title refactor(todos): compose canonical quota sources and bound responses refactor(todos): compose canonical quota reads and bound responses Nov 7, 2026
cocolord and others added 8 commits November 8, 2026 07:54
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
loopx-agent
loopx-agent previously approved these changes Nov 8, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

托管 quota guard 使用当前 Todo 来源生成 User 与 Agent 视图,需要完整、及时且身份一致的读取。

原入口重复编码来源;已选 SQLite snapshot 还分别打开连接读取身份和 head,每次快照产生四次只读连接。

本次复核确认组合读取保留完整结果,SQLite 身份与 head 合并后只读连接降为三次,读取后的独立身份检查仍会拒绝数据库替换。

本次边界是既有内部读取、兼容输入和有界传输,没有新增产品操作、持久状态或配置。

完整生命周期成本、已部署宿主和模型的持续采用及 split-install 资格仍未闭合。

改动思路 / Approach

存储事务、快照身份复核和 Todo 语义各由既有 owner 负责;合并读取不引入第二份权威。当前切片仅复用完整来源、保留兼容输入和有界传输,并减少已选 SQLite 的一次只读连接;完整成本和部署采用继续开放。将 provider 选择、读取和最终身份复核全删成一次查询会更短,但其来源诊断和重新打开路径的职责不同,实际替换反例证明最终复核不可删除。

相对上次已审的 c40d8ec311448eb2c42f90094252e8626f220aaf,20 个原有 production 文件逐字节相同,新增行为集中在三份 coordination 源码。本轮同时审查完整 35 文件差异,并验证与实际 main b78246ff7925a34084d16520040d69ecd6b92316 的合并树;23 个 PR production 文件与该合并树相同。发布前 head 从 779 更新为本 head;相对本轮已经实测的 main 合并树,仅有两份 RFC 新增成本记录,全部运行时代码相同。新 head 另补跑 source、类型与 wheel 验证。旧证据保留原 revision,没有把旧批准移用到新 head。

具体改动 / Changes

关键代码讲解

  • readAuthoritySnapshot 沿既有 optional acceleration seam 分派。未提供方法的 provider 仍先读取身份;身份失败不再开第二次 IO,身份不可用时保留原 missing 探查和失败优先级。
  • SqliteAuthorityStore.readSnapshot 仅在 existingOnly 已选 store 开放,同步只读事务内用原 current() 证明完整 head。没有跨调用连接、head 缓存、初始化或写入权限。
  • readCanonicalSnapshotFromStore 保留 revision、cursor、完整来源和分页检查,读取后仍独立重新打开原路径核对身份。实际将目录替换为“相同行、不同数据库身份”会返回 canonical_snapshot_changed,不返回部分行或 legacy fallback。
  • readCanonicalQuotaProjection 继续复用匹配来源的 typed Todo 事务。旧 asset 显式分支、完整来源和分段 gzip 没有新增语义 owner;当前 legacy、传输、source 和原 Turn 恢复检查重新覆盖共享调用条件。

规范依据是 docs/architecture/rfcs/monorepo-distribution-split-v0.md,spec_revision=b78246ff7925a34084d16520040d69ecd6b92316。I2 的单 owner 由现有存储/快照/Todo 分工实现;I3 的 public import 兼容窗口保留,没有本次迁移或删除;I8 的完整新鲜来源和重放身份由替换反例、来源检查及恢复用例实现;I9 只报告具名环境与真实测量边界。V10 / R0 的完整成本和 managed/installed journey 明确 deferred,不能由本轮连接数与通过数代替。

对主干的风险 / Risks

本轮独立探针在 Node24.21.0/SQLite3.53.4 的同一 464-Todo 数据库比较完整响应与原入口 oracle,数据库内容 hash 不变,只读连接从 main 的 4 次降至候选及隔离 wheel 的 3 次。普通 SQLite 和 File 没有该加速方法;真实 PostgreSQL16.15 的 391 项存储及 11 项服务检查通过,零 skip,隔离 server 已停止。只在进程内取消最终身份检查后,同一实际目录替换探针观察到错误的 page 而失败,证明负例能区分栅栏缺失。

源码 199 项 Python 检查通过,14 项要求显式 native Codex 的用例跳过且未作资格声明;准确 head 和运行时代码相同的实际合并树各 63 项 TypeScript 检查通过。原 Turn 的 File/SQLite 八种恢复组合在 main、head、该实际合并树及隔离 wheel 均通过;wheel 的 legacy 与恢复检查共 21 项通过,23 个变更 production 源码与 Git 完全相同。Ruff、tsc、完整 17-root kernel mypy 通过。首个新 head wheel 构建因旧前端 bundle 元信息失效而被拒绝,重新构建 bundle 后完成隔离核验;失败记录保留,没有放宽包装检查。

语义与 CI 对齐

标准 premerge 的 6 项直接检查和 19 项所选检查中的 18 项通过。Required peer hard-cut 仍在未改的 benchmark_toolkit/README.md:976 失败;完整归一化 traceback 在不可变 main 与本 head 相同,只替换 checkout 路径。相关 README、两个 scanner 和 workflow 逐字节相同。该失败和严格 CQR 继续保留,不能因代码批准视为通过。旧 missing-return mypy 失败保留为历史记录,本轮当前完整检查已通过。托管 CI 按当前策略未查询。

我的整体评价 / Verdict

没有新增阻塞性代码发现,批准该精确 head。长期工作语义和现有使用体验判断为 preserved:来源、身份、兼容输入、失败恢复与原结算保持,内部冗余读取有可复核的减少。新增 AuthorityStoreSnapshotResult 是已有两种结果的派生组合,不是持久状态、新 wire 词表或权限。复用现有 seam 是本次已应用的有界简化;扩大 provider 选择重构没有当前依据。

旧 6,401/8,000 条及低重复度 gzip 证据仍绑定原 c40 revision,并通过 20 份源码一致性及当前 caller/backend 证据复核适用范围。本轮没有重跑完整性能实验。作者最新五对生命周期墙钟中位数 main/candidate 为 14.255/14.382 秒,采样 CPU 为 6.873/7.141 秒,三次候选更慢且范围重叠;RPC 插桩还观察到 todo.read 从 18 增到 26 次,额外 0.172 秒采样 Node CPU。退出尾部诊断不替代无插桩性能,完整系统峰值、模型和人工成本仍未覆盖。这些是作者具名观察,不能据此宣称完整提速,也不足以支持删除来源/身份/恢复检查。I3、M1/#8011、R0/V10/R1、D2/D5/D6/D3、installed-host/model/context/split-install 和持续采用均保持开放。批准结论与必需验证、正式平台 review 和合并资格分别读回;本轮未合并。

English verdict: APPROVE for b7e5bc8c65d8ad03e59786847df6e0aa0d37df3d. Selected SQLite snapshot pairing preserves freshness, provider fallback and original recovery; required local qualification and full-cost/adoption gates remain open.

@cocolord
cocolord dismissed loopx-agent’s stale review November 8, 2026 00:39

The merge-base changed after approval.

cocolord and others added 6 commits November 8, 2026 08:47
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@cocolord cocolord changed the title refactor(todos): compose canonical quota reads and bound responses Reuse canonical Todo reads across quota and refresh projections Nov 8, 2026
loopx-agent and others added 7 commits November 8, 2026 09:51
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ision-context

Expose linked measurements for the first Yardstick choice
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@huangruiteng
huangruiteng merged commit 481436a into main Nov 8, 2026
31 of 41 checks passed
@huangruiteng
huangruiteng deleted the codex/small-kernel-todo-projection-20261107 branch November 8, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants